import java.util.ArrayList;
import java.util.List;

import Entity.DANXUAN_Entity;
import Entity.IEntityF1;

public class Ti {
    
    // public boolean is_youxiao;
    public String timu=null;
    public String daan=null;
    public String jiexi=null;

    public List<String> xuanxiang=new ArrayList<>();

    private  void fill_value(DANXUAN_Entity data,  int entity_idx, String value) {
        switch (entity_idx) {
            case 1:
                data.setStr1(value);
                break;
            case 2:
                data.setStr2(value);
                break;
                case 3:
                data.setStr3(value);
                break;
           
           case 4:
                data.setStr4(value);
                break;
           
           case 5:
                data.setStr5(value);
                break;
           
           case 6:
                data.setStr6(value);
                break;
           
           case 7:
                data.setStr7(value);
                break;
           
           case 8:
                data.setStr8(value);
                break;
           
           case 9:
                data.setStr9(value);
                break;
           
           case 10:
                data.setStr10(value);
                break;
           
        //    case 11:
        //         data.setStr11(value);
        //         break;

            default:
                break;
        }    
    }
    
    public DANXUAN_Entity convert_to_data(){
        if(this.timu==null){
            return null;
        }
        DANXUAN_Entity data=new DANXUAN_Entity();
        fill_value(data,2, this.timu);

        if(this.daan!=null){
            fill_value(data,3, this.daan);
        }

        if(this.jiexi!=null){
            fill_value(data,4, this.jiexi);
        }

        int i=5;
        for (String string : xuanxiang) {
            fill_value(data,i++, string);
        }
        return data;
    }
}
